<?php

namespace app\beautiful\model;

use app\common\model\CommonModel;



class PrinterModel extends CommonModel{

    protected  $name = 'beautiful_printer';

    protected  $pk   = 'printer_id';



    public function setJurisdictionAttr($value)

    {

        if($value){
            return implode(',',$value);
        }
        return null;

    }



    public function getJurisdictionAttr($value)

    {
        $jurisdiction=[];
        if($value){
            $jurisdiction=explode(',',$value);

            foreach ($jurisdiction as $k => $v){

                $jurisdiction[$k]= $v;

            }
        }
        return $jurisdiction;

    }



    public function getAppTypeMeanAttr($value,$data)

    {

        $app_type_mean=[

            'yly'=>'易联云',

            'feie'=>'飞鹅'

        ];

        return $app_type_mean[$data['app_type']] ?? '-';

    }

}

